import request from '@/utils/request'

// 查询活动列表
export function listPick(query) {
  return request({
    url: '/pick/list',
    method: 'get',
    params: query
  })
}

// 查询活动列表
export function listPickClick(query) {
  return request({
    url: '/pick/listClick',
    method: 'get',
    params: query
  })
}

// 查询上一条活动详细
export function getUpPick(pickId) {
  return request({
    url: '/pick/getUpPick/' + pickId,
    method: 'get',
  })
}
// 查询下一条活动详细
export function getNextPick(pickId) {
  return request({
    url: '/pick/getNextPick/' + pickId,
    method: 'get'
  })
}

// 查询活动详细
export function getPick(pickId) {
  return request({
    url: '/pick/' + pickId,
    method: 'get'
  })
}

// 新增活动
export function addPick(data) {
  return request({
    url: '/pick',
    method: 'post',
    data: data
  })
}

// 修改活动
export function updatePick(data) {
  return request({
    url: '/pick',
    method: 'put',
    data: data
  })
}
export function updatePickClick(data) {
  return request({
    url: '/pick/updatePickClick',
    method: 'put',
    data: data
  })
}

// 删除活动
export function delPick(pickId) {
  return request({
    url: '/pick/' + pickId,
    method: 'delete'
  })
}
